<template>
  <div>
    <el-input-number
      v-model="count"
      controls-position="right"
      @change="inputChange($event, 'count')"
      :min="1"
      size="small"
    ></el-input-number>
  </div>
</template>

<script>
export default {
  name: 'InputNumber',
  components: {},
  data() {
    return {
      count: 1 // 默认商品添加的数量为1
    }
  },
  props: ['row'],
  methods: {
    // 商品计数器，上货数量的改变
    inputChange(e, val) {
      this[val] = e
      this.tablekey = !this.tablekey
      // 商品数量改变，总价格改变
      this.$emit('my_price', e, this.row.number)
      this.$emit('my_count', e, this.row.barcode)
    }
  }
}
</script>

<style></style>
